package com.pvdnc.xdynamic.loader.classloader;

import java.lang.reflect.Field;

import dalvik.system.BaseDexClassLoader;

public class ClassLoaderUtils {
    private static Field getPathListField() throws NoSuchFieldException {
        Field field= BaseDexClassLoader.class.getDeclaredField("pathList");
        field.setAccessible(true);
        return field;
    }

    public static Object getPathList(ClassLoader cl) throws Exception {
        return getPathListField().get(cl);
    }

    public static void setPathList(ClassLoader cl,Object pathList) throws Exception{
        getPathListField().set(cl,pathList);
    }
}
